import Vue from 'vue'
import Router from 'vue-router'
//import Index from '@/pages/Index'
import Article from '@/components/Article'
import Material from '@/components/Material'
import Release from '@/components/Release'

import FansList from '@/components/Release/FansList'
import FansAdd from '@/components/Release/FansAdd'
import FansImport from '@/components/Release/FansImport'
import FansView from '@/components/Release/FansView'
import ReleaseInvitation from '@/components/Release/ReleaseInvitation'
/*import ReleaseLeft from '@/components/Release/ReleaseLeft'*/
import ReleaseManage from '@/components/Release/ReleaseManage'

/*素材管理*/
import SendArticle from '../components/Material/SendArticle.vue'

/*import MaterialRecovery from '../components/Material/MaterialRecovery.vue'
import MaterialImg from '../components/Material/MaterialImg.vue'
import ImportArticle from '../components/Material/ImportArticle.vue'*/

/*登陆 相关*/
import login from '@/components/LoginRegister/Login'
import cropper from '../components/cropper.vue'
/*import Register from '@/components/LoginRegister/Register'
import ForgetPassword from '@/components/LoginRegister/ForgetPassword'
import FixPassword from '@/components/LoginRegister/FixPassword'*/
import LoginRegister from '@/components/LoginRegister/loginForm'

import DataStatistic from '@/components/DataStatistic'
//预览页面
import Tb from '@/components/previewPage/tb'
import Wx from '@/components/previewPage/wx'
import Wb from '@/components/previewPage/wb'

Vue.use(Router);
const createRouter = () => {
  const router = new Router({
    routes: [
      {
        path: '/Article',
        name: 'Article',
        component: Article,
        meta: {auth: true}
      },
      {
        path: '/Material',
        name: 'Material',
        component: Material,
        meta: {auth: true},
        children: [
          {
            path: 'Image',
            name: 'Image',
            component:  resolve =>require(['../components/Material/MaterialImg.vue'], resolve),
            meta: {auth: true}
          },
          {
            path: 'Recovery',
            name: 'Recovery',
            component: resolve =>require(['../components/Material/MaterialRecovery.vue'], resolve),
            meta: {auth: true}
          },
          {
            path: 'SendArticle',
            name: 'SendArticle',
            component: SendArticle,
            meta: {auth: true}
          },
          {
            path: 'ImportArticle',
            name: 'ImportArticle',
            component: resolve =>require(['../components/Material/ImportArticle.vue'], resolve),
            meta: {auth: true}
          },
        ]
      },
      {
        path: '/',
        name: 'login',
        component: login
      }, {
        path: '/Register',
        name: 'Register',
        component: resolve =>require(['../components/LoginRegister/Register.vue'], resolve),
      }, {
        path: '/ForgetPassword',
        name: 'ForgetPassword',
        component: resolve =>require(['../components/LoginRegister/ForgetPassword.vue'], resolve),
      }, {
        path: '/FixPassword',
        name: 'FixPassword',
        component: resolve =>require(['../components/LoginRegister/FixPassword.vue'], resolve),
      }, {
        path: '/Release',
        name: 'Release',
        component: Release,
        meta: {auth: true},
        children: [
          {
            path: 'FansList',
            name: 'FansList',
            component: FansList,
            meta: {auth: true}
          },
          {
            path: 'FansView',
            name: 'FansView',
            component: FansView,
            meta: {auth: true}
          },
          {
            path: 'FansImport',
            name: 'FansImport',
            component: FansImport,
            meta: {auth: true}
          },
          {
            path: 'FansAdd',
            name: 'FansAdd',
            component: FansAdd,
            meta: {auth: true}
          },
          {
            path: 'ReleaseInvitation',
            name: 'ReleaseInvitation',
            component: ReleaseInvitation,
            meta: {auth: true}
          },
          {
            path: 'ReleaseManage',
            name: 'ReleaseManage',
            component: ReleaseManage,
            meta: {auth: true}
          },
        ]
      }, {
        path: '/LoginRegister',
        name: 'LoginRegister',
        component: LoginRegister
      }, {
        path: '/DataStatistic',
        name: 'DataStatistic',
        component: DataStatistic,
        meta: {auth: true}
      }, {
        path: '/tb',
        name: 'tb',
        component: Tb,
        meta: {auth: true}
      }, {
        path: '/wx',
        name: 'wx',
        component: Wx,
        meta: {auth: true}
      }, {
        path: '/wb',
        name: 'wb',
        component: Wb,
        meta: {auth: true}
      } ,{
        path: '/cropper',
        name: 'cropper',
        component: cropper,
        meta: {auth: true}
      }

    ]
  });

  return router;
};


export default new createRouter({})
